<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>简单计算器</h1>
        <div>
            <span>数值A:</span>
            <span>
        <input type="text" v-model.number = 'a'>
      </span>
        </div>
        <div>
            <span>数值B:</span>
            <span>
        <input type="text" v-model.number = 'b'>
      </span>
        </div>
        <div>
            <button @click='handle'>计算</button>
        </div>
        <div>
            <span>计算结果:</span>
            <span v-text='res'></span>
        </div>
    </div>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript">
        /*
                                                                                      要求: 实现简单计算器案例, 不能使用parseInt 
                                                                                    */
        var vm = new Vue({
            el: '#app',
            data: {
                a: '',
                b: '',
                res: ''
            },
            methods: {
                handle: function() {
                    this.res = this.a + this.b
                }
            }
        });
    </script>
</body>

</html>